package com.example.list;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class BtnBgActivity extends AppCompatActivity {

    private Button btn1;
    private Button btn2;
    private Button btn3;
    private EditText et;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        int a = 5;//git exclude 测试
        setContentView(R.layout.activity_btn_bg);
        btn1 = (Button) findViewById(R.id.btnbg1);
        btn2 = (Button) findViewById(R.id.btnbg2);
        btn3 = (Button) findViewById(R.id.btnbg3);
        et = (EditText) findViewById(R.id.bta_et);
        et.setText("");
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

             btn1.setSelected(true);
             btn2.setSelected(false);
             btn3.setSelected(false);

            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn1.setSelected(false);
                btn2.setSelected(true);
                btn3.setSelected(false);
            }
        });
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn1.setSelected(false);
                btn2.setSelected(false);
                btn3.setSelected(true);
            }
        });
    }
}